#include <iostream>
#include <string>
#include <map>
int main()
{
    std::map<std::string, int> dic;
    while(std::cin){
        std::string key;
        int value;
        std::cin >> key >> value;
        if(key == "exit"){
            break;
        }
        if(dic.find(key) != dic.end()){
            dic[key] += value;
        }else{
            dic[key] = value;
        }
    }
    typedef std::map<std::string,int>::const_iterator CIT;
    CIT end = dic.end();
    for(CIT beg = dic.begin(); beg != end; ++beg){
        std::cout << (*beg).first << " : " << (*beg).second << std::endl;
    }
    
        
    
}

        
